/* 
 * File:   hfgl_picture.cpp
 * Author: Satan
 * 
 * Created on September 12, 2012, 11:09 PM
 */

#include "hfgl/hfgl_picture.h"

hfgl_picture::hfgl_picture() 
{
    m_arrayCount = 0;
    m_surfaces = NULL;
}

hfgl_picture::hfgl_picture(int arrayCount, hfgl_surface** surfaces)
{
    m_arrayCount = arrayCount;
    m_surfaces = surfaces;    
}

hfgl_picture::hfgl_picture(const hfgl_picture& orig) 
{
}

hfgl_picture::~hfgl_picture() 
{
    clear();
}

void hfgl_picture::clear()
{
    if (m_surfaces)
    {
        for (int i = 0; i < m_arrayCount; i++)
        {
            hfgl_surface *tmp = m_surfaces[i];
            delete tmp;
        };
        
        delete[] m_surfaces;
        m_surfaces = NULL;
        m_arrayCount = 0;
    }
}

int hfgl_picture::getArrayCount()
{
    return m_arrayCount;
}
hfgl_surface* hfgl_picture::getSurface(int pos)
{
    if (pos < m_arrayCount)
        return m_surfaces[pos];
    else
        return NULL;
}